home *** CD-ROM | disk | FTP | other *** search
/ IRIX Installation Tools & Overlays 2002 November / SGI IRIX Installation Tools & Overlays 2002 November - Disc 4.iso / dist / motif21_dev.idb / usr / share / src / X / motif-2.1 / osf_demos / tools / wml / UilDBDef.h.z / UilDBDef.h
C/C++ Source or Header  |  2002-10-15  |  15KB  |  426 lines

  1. /* 
  2.  *  @OSF_COPYRIGHT@
  3.  *  COPYRIGHT NOTICE
  4.  *  Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
  5.  *  ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
  6.  *  the full copyright text.
  7. */ 
  8. /* 
  9.  * HISTORY
  10. */ 
  11. /*   $XConsortium: UilDBDef.h /main/8 1995/07/13 21:03:16 drk $ */
  12.  
  13. /*
  14. *  (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
  15.  
  16. /*
  17. **++
  18. **  FACILITY:
  19. **
  20. **      User Interface Language Compiler (UIL)
  21. **
  22. **  ABSTRACT:
  23. **
  24. **      This include file defines the interfaces necessry to the binary 
  25. **    data base in the WML & UIL compilers.
  26. **
  27. **--
  28. **/
  29.  
  30. #ifndef UilDBDef_h
  31. #define UilDBDef_h
  32.  
  33. /***********************************************************************
  34. ****************** From UilDef.h ***************************************/
  35. #define _BIT_INDEX(_type)    \
  36.             (((unsigned int) (_type)) >> 3)
  37.  
  38. #define _BIT_MASK(_type)    \
  39.   (1 << (((unsigned int) (_type)) & 0x7))
  40.  
  41. #define _BIT_SET(table_entry_addr, _type) \
  42.   ( _BIT_MASK (_type) &  \
  43.     ( ((unsigned char *) (table_entry_addr)) \
  44.       [ _BIT_INDEX (_type) ] ) )
  45.  
  46. /*******************************************************************
  47. **************** From UilSymDef.h *********************************/
  48. /*
  49. **  Hash table size
  50. */
  51.  
  52. #define sym_k_hash_table_limit    127
  53.  
  54. /* 
  55. **  Symbol tags.  These values are used in the tag field of every object header
  56. **  to identify the type of the entry.
  57. */
  58.  
  59. #define sym_k_error_entry        (127)
  60.     /*    An error entry is used when compilation errors are detected in the  */
  61.     /*    source program.  Its use reduces cascading errors caused by missing */
  62.     /*    information and allows the compilation to continue and thus        */
  63.     /*    additional errors may be detected                    */
  64. #define sym_k_value_entry        1
  65.     /*    A value entry contains information about a UIL literal value        */
  66.     /*    (integer, string, compound string, xbitmapfile, argument, color,    */
  67.     /*    icon, etc.).  The b_type field is used to determine the datatype of */
  68.     /*    this value.                                */
  69. #define sym_k_name_entry        2
  70.     /*    A name entry corresponds to a name (identifier) used in the UIL        */
  71.     /*    source.                                    */
  72. #define sym_k_widget_entry        3
  73.     /*    A widget entry represents a widget declaration.  It points off to   */
  74.     /*    the arguments, callbacks, and controls lists for the widget.        */
  75. #define sym_k_control_entry        4
  76.     /*    A control entry hangs off a list entry and identifes an object        */
  77.     /*    (widget or gadget) that is controlled.  It also contains the        */
  78.     /*    managed/unmanaged information.                        */
  79. #define sym_k_forward_ref_entry        5
  80.     /*    forward reference entries are a linked listed of objects        */
  81.     /*    (widgets/gadgets) that were not defined at the time of the        */
  82.     /*    reference.  After all objects have been seen, then this list is        */
  83.     /*    traversed and all objects in it should now be defined and the        */
  84.     /*    specified pointers can be filled-in.                    */
  85. #define sym_k_external_def_entry    6
  86.     /*    An external definition entry identifies a name that has been        */
  87.     /*    imported and thus in not declared within this source module.        */
  88. #define sym_k_argument_entry        7
  89.     /*    An argument entry hangs off a list entry and identifies an object   */
  90.     /*    argument.  It contains informtation about the argument name and        */
  91.     /*    argument value.                                */
  92. #define sym_k_callback_entry        8
  93.     /*    An calllback entry hangs off a list entry and identifies an object  */
  94.     /*    callback.  It contains informtation about the callback name,        */
  95.     /*    callback procedure, and callback tag.                    */
  96. #define sym_k_module_entry        9
  97.     /*    A module entry contains information specified on the module        */
  98.     /*    statement.                                */
  99. #define sym_k_proc_def_entry        10
  100.     /*    A procedure definition entry is created for each procedure listed   */
  101.     /*    in a procedure section.  I contains informaion on the number and    */
  102.     /*    types of the arguments.                            */
  103.  
  104. #define sym_k_proc_ref_entry        11
  105.     /*    A procedure reference entry contains information about a the use of */
  106.     /*    a procedure (e.g. as a callback).  It also stores the tag to be        */
  107.     /*    passed to the procedure.                        */
  108. #define sym_k_list_entry        12
  109.     /*    A list entry is a typed list of other symbol table entries. It        */
  110.     /*    contains a count and a pointer to the next entry on the list via    */
  111.     /*    the obj_header.az_next field.                        */
  112. #define sym_k_child_entry        13
  113.     /*    A child entry represents a declaration for an                  */
  114.     /*    automatically created child.  It points off to               */
  115.     /*    the arguments, callbacks, and controls lists for the child. Since   */
  116.     /*    the structures for widget and child are the same, the            */
  117.     /*    datastructure for children is really a sym_k_widget_entry_type.        */
  118. #define sym_k_identifier_entry        14
  119.     /*    identifier entry tag is used for diagnostic messages only        */
  120. #define sym_k_color_item_entry        15
  121.     /*    entry describing a color.                        */
  122. #define sym_k_gadget_entry        16
  123.     /*    A gadget entry represents a gadget declaration.  It points off to   */
  124.     /*    the arguments, callbacks, and controls lists for the gadget. Since  */
  125.     /*    the structures for widget and gadgets are the same, the            */
  126.     /*    datastructure for gadgets is really a sym_k_widget_entry_type.        */
  127. #define sym_k_root_entry        17
  128.     /*    An entry used to group all the other entries together.  It is        */
  129.     /*    returned in the parse_tree_root field of the compilation descriptor */
  130.     /*    when using the callable interface.                    */
  131. #define sym_k_parent_list_entry        18
  132.     /*    This is a list of parents of a widget.  It is used to check for        */
  133.     /*    constraints provided by the parent that may be used on this widget. */
  134. #define sym_k_nested_list_entry        19
  135.     /*  This entry occurs as a list entry for a nested list. It occupies    */
  136.     /*  the correct position in the list for the reference to a list, and   */
  137.     /*  points to the actual list entry.                                    */
  138. #define sym_k_include_file_entry    20
  139.     /*    An include file entry is used to describe the contents of an        */
  140.     /*    include file.  It is needed only maintain information about the        */
  141.     /*    source file from which this parse tree was generated.  It is not    */
  142.     /*    used by UIL directly.                            */
  143. #define sym_k_section_entry        21
  144.     /*    A section entry is used to describe the contents of an source file. */
  145.     /*    It is needed only maintain information about the structure of        */
  146.     /*    source file from which this parse tree was generated.  It is not    */
  147.     /*    used by UIL directly.                            */
  148.     /*                                        */
  149. #define sym_k_def_obj_entry        22
  150.     /*    This entry corresponds to the default object clause on the module   */
  151.     /*    declaration it is used to store source information about the file   */
  152.     /*    from which this parse tree was generated.   It is not used by UIL   */
  153.     /*    directly.                                */
  154. #define sym_k_UNUSED23_entry        23
  155. #define sym_k_val_forward_ref_entry    24
  156.     /*    val forward reference entries are a linked listed of values        */
  157.     /*    that were not defined at the time of the                */
  158.     /*    reference.  After all values have been seen, then this list is        */
  159.     /*    traversed and all values in it should now be defined and the        */
  160.     /*    specified pointers can be filled-in.                    */
  161. #define sym_k_max_entry            24
  162.     /*    this is the largest possible value for an entry constant.        */
  163.  
  164.  
  165. /*
  166. **    Common attribute masks -- These values are used in the b_flags field of
  167. **    the object_header.
  168. */
  169.  
  170. #define        sym_m_private        (1 << 0)
  171.     /*    This item is private to this source module and thus need not be        */
  172.     /*    output into the UID file.                        */
  173. #define        sym_m_exported        (1 << 1)
  174.     /*    This is an exported definition and must be put in the UID file.        */
  175. #define        sym_m_imported        (1 << 2)
  176.     /*    This item is a reference external to this source module and thus    */
  177.     /*    will be resolved at runtime by searching the resourec hierarchy.    */
  178. #define        sym_m_reference        (1 << 3)
  179. #define        sym_m_builtin        (1 << 4)
  180.     /*    This item is builtin as oppose to a userdefined item.            */
  181. #define        sym_m_obj_is_gadget    (1 << 5)
  182.     /*    This object is a gadget as oppose to a widget.                */
  183.  
  184.  
  185. /*
  186. **    Output states - order is important
  187. */
  188.  
  189. #define        sym_k_not_processed    0
  190. #define        sym_k_queued        1
  191. #define        sym_k_emitted        2
  192.  
  193.  
  194.  
  195. /*
  196. **    Constants to define compiler-recognized data types. It is
  197. **    important that the names used in .wml language descriptions
  198. **    match these names. These values were once automatically generated
  199. **    by WML. They are now maintained by hand to reduce compiler
  200. **    dependence on WML artifacts.
  201. **
  202. **      We have also separated the values loosely into two classes:
  203. **      values which can be used to verify operator legality and values
  204. **      which cannot (see UilSemVal.c -- the legal_operand_type table).
  205. **      There is a comment below denoting where the separation is. Any
  206. **      values above the comment may be used for validation of an operator
  207. **      while any values below may not.
  208. **
  209. **      The order of the values below is unimportant except that the
  210. **      entries in the uil_datatype_names table in UilData.c must be
  211. **      ordered the same way.
  212. */
  213. #define sym_k_any_value            1
  214. #define sym_k_bool_value        2
  215. #define sym_k_char_8_value        3
  216. #define sym_k_compound_string_value    4 
  217. #define sym_k_float_value        5
  218. #define sym_k_integer_value        6 
  219. #define sym_k_single_float_value    7
  220. #define sym_k_localized_string_value    8
  221. #define sym_k_wchar_string_value    9
  222. #define sym_k_horizontal_integer_value  10
  223. #define sym_k_vertical_integer_value    11
  224. #define sym_k_horizontal_float_value    12
  225. #define sym_k_vertical_float_value      13
  226. /* Values after here may not be used for operator argument validation */
  227. #define sym_k_argument_value        14
  228. #define sym_k_asciz_table_value        15
  229. #define sym_k_class_rec_name_value    16
  230. #define sym_k_color_value        17
  231. #define sym_k_color_table_value        18
  232. #define sym_k_font_value        19
  233. #define sym_k_font_table_value        20
  234. #define sym_k_icon_value        21
  235. #define sym_k_identifier_value        22
  236. #define sym_k_integer_table_value    23
  237. #define sym_k_keysym_value        24
  238. #define sym_k_pixmap_value        25
  239. #define sym_k_reason_value        26
  240. #define sym_k_rgb_value            27
  241. #define sym_k_string_table_value    28
  242. #define sym_k_trans_table_value        29
  243. #define sym_k_widget_ref_value        30
  244. #define sym_k_xbitmapfile_value        31
  245. #define sym_k_fontset_value        32
  246. #define    sym_k_child_value        33
  247. #define sym_k_max_value            33
  248. #define sym_k_no_value            (sym_k_max_value+1)
  249.  
  250. /*
  251.  * Error values for all kind of sym_k_... literal set
  252.  */
  253. #define sym_k_error_value        0
  254. #define sym_k_error_object        0
  255. #define sym_k_error_charset        0
  256.  
  257.  
  258. /*
  259.  * Literals associated with character sets
  260.  *
  261.  * Character set character sizes
  262.  */
  263. #define sym_k_onebyte_charsize    1
  264. #define sym_k_twobyte_charsize    2
  265. #define sym_k_mixed1_2byte_charsize    3
  266.  
  267. /*
  268.  * User-defined character set
  269.  */
  270. #define sym_k_userdefined_charset    1
  271.  
  272. /*
  273.  * XmFONTLIST_DEFAULT_TAG 
  274.  */
  275. #define sym_k_fontlist_default_tag     0
  276.  
  277. /*
  278. **    value sets defining expression operators
  279. */
  280. #define sym_k_unspecified_op    0
  281. #define sym_k_not_op        1 
  282. #define sym_k_unary_plus_op    2
  283. #define sym_k_unary_minus_op    3
  284. #define sym_k_comp_str_op    4
  285. #define sym_k_wchar_str_op    5
  286. #define sym_k_last_unary_op    5
  287.  
  288. #define sym_k_multiply_op    6
  289. #define sym_k_divide_op        7
  290. #define sym_k_add_op        8
  291. #define sym_k_subtract_op    9
  292. #define sym_k_left_shift_op    10 
  293. #define sym_k_right_shift_op    11
  294. #define sym_k_and_op        12
  295. #define sym_k_xor_op        13
  296. #define sym_k_or_op        14
  297. #define sym_k_cat_op        15
  298. #define sym_k_last_binary_op    15
  299. #define sym_k_valref_op        16    /* az_exp_op1 points to the value node
  300.                        whose value is referenced by this
  301.                        value node. */
  302. #define sym_k_coerce_op        17    /* az_exp_op1 points to the value node
  303.                        whose value is to be coerced to the
  304.                        data type of this node. */
  305. #define sym_k_last_special_op    17
  306.  
  307. /*
  308.  * Structure of an enumeration set entry
  309.  */
  310. typedef struct
  311.     {
  312.     short int        values_cnt;
  313.     /* number of values in the enuemration set descriptor        */
  314.     unsigned short int    *values;
  315.     /* vector of values                        */
  316.     } UilEnumSetDescDef, *UilEnumSetDescDefPtr;
  317.  
  318.  
  319.  
  320. /**********************************************************************
  321. **************** From UilKeyDef.h ************************************/
  322. /*
  323.  *    Token class literals
  324.  */
  325. #define tkn_k_class_argument    1
  326. #define tkn_k_class_charset     2
  327. #define tkn_k_class_color       3
  328. #define tkn_k_class_enumval     4
  329. #define tkn_k_class_font        5
  330. #define tkn_k_class_identifier  6
  331. #define tkn_k_class_keyword     7
  332. #define tkn_k_class_literal     8
  333. #define tkn_k_class_reason      9
  334. #define tkn_k_class_reserved    10
  335. #define tkn_k_class_special     11
  336. #define tkn_k_class_unused      12
  337. #define tkn_k_class_class       13
  338. #define tkn_k_class_child    14
  339.  
  340. /*
  341.  * Keyword table entry structure
  342.  */
  343. typedef struct 
  344.     {
  345.     unsigned char         b_class;
  346.     unsigned short int    b_subclass;
  347.     unsigned char         b_length;
  348.     unsigned char         b_token;
  349.     char                  *at_name;
  350.     }  key_keytable_entry_type;
  351.  
  352.  
  353.  
  354. /*************************************************************************
  355. ************************ New Stuff **************************************/
  356.  
  357. /* For COMPOUND_STRING_COMPONENT */
  358. #define XmStringComponent "XmStringComponent"
  359.  
  360. /*
  361.  * Names of the tables put in the binary database
  362. */
  363.  
  364. #define Constraint_Tab 1
  365. #define Key_Table 2
  366. #define Key_Table_Case_Ins 3
  367. #define Allowed_Argument_Table 4
  368. #define Argument_Type_Table_Value 5
  369. #define Charset_Xmstring_Names_Table 6
  370. #define Charset_Wrdirection_Table 7
  371. #define Charset_Parsdirection_Table 8
  372. #define Charset_Charsize_Table 9
  373. #define Charset_Lang_Names_Table 10
  374. #define Charset_Lang_Codes_Table 11
  375. #define Allowed_Control_Table 12
  376. #define Enum_Set_Table 13
  377. #define Argument_Enum_Set_Table 14
  378. #define Enumval_Values_Table 15
  379. #define Uil_Widget_Names 16
  380. #define Uil_Argument_Names 17
  381. #define Uil_Reason_Names 18
  382. #define Uil_Enumval_names 19
  383. #define Uil_Charset_Names 20
  384. #define Related_Argument_Table 21
  385. #define Allowed_Reason_Table 22
  386. #define Uil_Widget_Funcs 23
  387. #define Uil_Gadget_Funcs 24
  388. #define Uil_Urm_Nondialog_Class 25
  389. #define Uil_Urm_Subtree_Resource 26
  390. #define Uil_Argument_Toolkit_Names 27
  391. #define Uil_Reason_Toolkit_Names 28
  392. #define Child_Class_Table    29
  393. #define Allowed_Child_Table    30
  394. #define Uil_Children_Names    31
  395.  
  396. /*
  397.  * Binary Data Base Work
  398.  */
  399. #define DB_Compiled_Version 2
  400.  
  401. typedef struct _db_globals_struct
  402. {
  403.     int        version;
  404.     int        uil_max_arg;
  405.     int        uil_max_charset;
  406.     int        charset_lang_table_max;
  407.     int        uil_max_object;
  408.     int        uil_max_reason;
  409.     int        uil_max_enumval;
  410.     int        uil_max_enumset;
  411.     int        key_k_keyword_count;
  412.     int        key_k_keyword_max_length;
  413.     int        uil_max_child;
  414. } _db_globals;
  415.    
  416. typedef struct _db_header_struct
  417. {
  418.     int        table_id;
  419.     int        num_items;
  420.     int        table_size;
  421. } _db_header, *_db_header_ptr;
  422.    
  423.  
  424. #endif /* UilDBDef_h */
  425. /* DON'T ADD STUFF AFTER THIS #endif */
  426.